<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Muse","version":"7.7.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="title:file指令 date:2020-02-16 22:00 file指令用来探测给定文件的类型。 file命令对文件的检查分为文件系统、魔法幻数检查和语言检查3个过程 1）语法：file （选项） （参数） 2）选项：-b: 列出辨识结果时，不显示文件名称； -c: 详细显示指令执行过程，便于排错或分析程序执行的情形； -f&lt;名称文件&gt; :指定名称文件，其内容有一个或多个文件">
<meta property="og:type" content="article">
<meta property="og:title" content="file指令">
<meta property="og:url" content="http://yoursite.com/2020/02/16/file%E6%8C%87%E4%BB%A4/index.html">
<meta property="og:site_name" content="tender healer">
<meta property="og:description" content="title:file指令 date:2020-02-16 22:00 file指令用来探测给定文件的类型。 file命令对文件的检查分为文件系统、魔法幻数检查和语言检查3个过程 1）语法：file （选项） （参数） 2）选项：-b: 列出辨识结果时，不显示文件名称； -c: 详细显示指令执行过程，便于排错或分析程序执行的情形； -f&lt;名称文件&gt; :指定名称文件，其内容有一个或多个文件">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://yoursite.com/2020/02/16/file%E6%8C%87%E4%BB%A4/wps1-1581851691998.jpg">
<meta property="og:image" content="http://yoursite.com/2020/02/16/file%E6%8C%87%E4%BB%A4/wps2-1581851692000.jpg">
<meta property="og:image" content="http://yoursite.com/2020/02/16/file%E6%8C%87%E4%BB%A4/wps3-1581851692000.jpg">
<meta property="article:published_time" content="2020-02-16T14:42:32.268Z">
<meta property="article:modified_time" content="2020-02-17T11:21:03.002Z">
<meta property="article:author" content="YQ Cong">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://yoursite.com/2020/02/16/file%E6%8C%87%E4%BB%A4/wps1-1581851691998.jpg">

<link rel="canonical" href="http://yoursite.com/2020/02/16/file%E6%8C%87%E4%BB%A4/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>file指令 | tender healer</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">tender healer</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">Recording learning gains</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/02/16/file%E6%8C%87%E4%BB%A4/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="YQ Cong">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="tender healer">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          file指令
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-02-16 22:42:32" itemprop="dateCreated datePublished" datetime="2020-02-16T22:42:32+08:00">2020-02-16</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-02-17 19:21:03" itemprop="dateModified" datetime="2020-02-17T19:21:03+08:00">2020-02-17</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>title:file指令</p>
<p>date:2020-02-16 22:00</p>
<h1 id="file指令"><a href="#file指令" class="headerlink" title="file指令"></a>file指令</h1><p>用来探测给定文件的类型。</p>
<p>file命令对文件的检查分为文件系统、魔法幻数检查和语言检查3个过程</p>
<h2 id="1）语法："><a href="#1）语法：" class="headerlink" title="1）语法："></a>1）语法：</h2><p><strong>file （选项） （参数）</strong></p>
<h2 id="2）选项："><a href="#2）选项：" class="headerlink" title="2）选项："></a>2）选项：</h2><p><strong>-b</strong>: 列出辨识结果时，不显示文件名称；</p>
<p><strong>-c</strong>: 详细显示指令执行过程，便于排错或分析程序执行的情形；</p>
<p><strong>-f&lt;名称文件&gt;</strong> :指定名称文件，其内容有一个或多个文件名称时，让file依序辨识，格式为每列一个文件名称；</p>
<p> <strong>-L</strong>:直接显示符号连接所指向的文件类别</p>
<p> <strong>-m</strong>&lt;魔法数字文件&gt;:指定魔法数字文件</p>
<p>  <strong>-v</strong>:显示版本信息</p>
<p>  <strong>-z</strong>:尝试去解读压缩文件的内容</p>
<h1 id="3）实例"><a href="#3）实例" class="headerlink" title="3）实例"></a>3）实例</h1><ul>
<li>查看文件类型 命令： file Temp.txt </li>
<li>不输出文件名称，只显示文件格式以及编码 命令： file -b Temp.txt</li>
</ul>
<p> <img src="/2020/02/16/file%E6%8C%87%E4%BB%A4/wps1-1581851691998.jpg" alt="img"></p>
<p><img src="/2020/02/16/file%E6%8C%87%E4%BB%A4/wps2-1581851692000.jpg" alt="img"> </p>
<p>  <img src="/2020/02/16/file%E6%8C%87%E4%BB%A4/wps3-1581851692000.jpg" alt="img"></p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/02/15/%E6%8C%87%E4%BB%A4%E3%80%81%E9%80%89%E9%A1%B9/" rel="prev" title="指令、选项">
      <i class="fa fa-chevron-left"></i> 指令、选项
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/02/17/find%E6%8C%87%E4%BB%A4/" rel="next" title="find指令">
      find指令 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#file指令"><span class="nav-number">1.</span> <span class="nav-text">file指令</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1）语法："><span class="nav-number">1.1.</span> <span class="nav-text">1）语法：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2）选项："><span class="nav-number">1.2.</span> <span class="nav-text">2）选项：</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#3）实例"><span class="nav-number">2.</span> <span class="nav-text">3）实例</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">YQ Cong</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">13</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">YQ Cong</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.2.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> v7.7.1
  </div>

        








      </div>
    </footer>
  </div>

  
  
  <script color='0,0,255' opacity='0.5' zIndex='-1' count='99' src="/lib/canvas-nest/canvas-nest.min.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
